package com.stox.charting.ui.swing.model;

import java.awt.Graphics;

import com.stox.charting.ui.swing.view.ChartView;
import com.stox.core.ui.swing.wrapper.JPanel;

public abstract class Chart<T> extends JPanel{
	private static final long serialVersionUID = -2745317593821954208L;
	
	private ChartView chartView;
	
	public Chart() {
		setOpaque(false);
	}
	
	@Override
	protected void paintComponent(Graphics g) {
		super.paintComponent(g);
		getModel().getViewport().paint(g);
	}
	
	public abstract ChartModel<T> getModel();
	
	public ChartView getChartView() {
		return chartView;
	}

	public void setChartView(ChartView chartView) {
		this.chartView = chartView;
	}
	
}
